import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPoolExecutor executor = new MyThreadPoolExecutor(4);
        for(int i = 0; i < 1000; i++) {
            int number = i;
            executor.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("线程: " + Thread.currentThread().getName() + "执行了任务: " + number);
                }
            });
        }
    }
    public static void main1(String[] args) {
        ExecutorService service = Executors.newFixedThreadPool(4);
        service.submit(()->{
            System.out.println("Ting");
        });
    }
}
